package service

import (
	"ginfast/pkg/dao"
	"ginfast/pkg/gctx"

	"github.com/gin-gonic/gin"
	"gorm.io/gorm"
)

func Clear(v interface{}, c *gin.Context) {
	dao.DB().Session(&gorm.Session{AllowGlobalUpdate: true}).Delete(v)
	gctx.JSONOK(c)
}